package com.ylwl.datacenterdemo.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Objects;

/**
 * Excel表头实体类
 */
@Data
@EqualsAndHashCode(of = {"index", "name"})
public class ExcelHeader {
    /**
     * 列索引
     */
    private final Integer index;
    
    /**
     * 原始列名
     */
    private final String name;
    
    /**
     * 转换后的字段名
     */
    private String fieldName;
    
    public ExcelHeader(Integer index, String name) {
        this.index = index;
        this.name = name;
    }
    
    /**
     * 判断是否为有效表头
     * @return 是否有效
     */
    public boolean isValid() {
        return name != null && !name.trim().isEmpty();
    }
}